package com.tg.demo.uaa.controller;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Rubble
 * @date 2020/8/27
 */
@RestController
public class HelloController {


    @GetMapping("/hello")
    public String hello(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        System.out.println("=========== authentication: "+ authentication);
        return "hello. currentTimeMillis: "+ System.currentTimeMillis();
    }
}
